package com.swpu.project.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.swpu.project.model.entity.Role;
import com.swpu.project.model.page.RoleDto;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 角色表 Mapper 接口
 * </p>
 *
 * @author ma
 * @since 2024-08-28
 */
public interface RoleMapper extends BaseMapper<Role> {


List<RoleDto> selectPageRoleWithMenus(@Param("start") int start, @Param("end") int end,
                                      @Param("orderBy") Map<String,Boolean> orderBy,
                                      @Param("queryBy") Map<String,String> queryBy);



Boolean addBatchRoleForUser(@Param("userId") String userId,@Param("roleList") List<String> roleIds);
Boolean dropBatchRoleForUser(@Param("userId") String userId,@Param("roleList") List<String> roleIds);
Boolean updateRoleForUser(@Param("userId")String userId,@Param("roleIds") Map<String,String> roleIds);

}
